package com.wmh.baseservice.merchant.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author wmh generator
 * @since 2022-11-07
 */
@ApiModel(value="MerchantMenu对象", description="管理员-菜单")
public class MerchantMenu implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "菜单名称")
    private String menuName;

    @ApiModelProperty(value = "菜单路由或接口路径")
    private String requestUrl;

    @ApiModelProperty(value = "菜单图标")
    private String menuIcon;

    @ApiModelProperty(value = "父级id")
    private Long parentId;

    @ApiModelProperty(value = "对应的组件")
    private String component;

    @ApiModelProperty(value = "标记:  1-菜单   2-接口")
    private Integer flag;

    @ApiModelProperty(value = "排序,   值越大排越前")
    private Integer sort;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "版本")
    @Version
    private Integer version;

    @ApiModelProperty(value = "备注")
    private String remark;

    @TableLogic
    private Integer deleted;

    public Long getId() {
        return id;
    }

    public MerchantMenu setId(Long id) {
        this.id = id;
        return this;
    }
    public String getMenuName() {
        return menuName;
    }

    public MerchantMenu setMenuName(String menuName) {
        this.menuName = menuName;
        return this;
    }
    public String getRequestUrl() {
        return requestUrl;
    }

    public MerchantMenu setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
        return this;
    }
    public String getMenuIcon() {
        return menuIcon;
    }

    public MerchantMenu setMenuIcon(String menuIcon) {
        this.menuIcon = menuIcon;
        return this;
    }
    public Long getParentId() {
        return parentId;
    }

    public MerchantMenu setParentId(Long parentId) {
        this.parentId = parentId;
        return this;
    }
    public String getComponent() {
        return component;
    }

    public MerchantMenu setComponent(String component) {
        this.component = component;
        return this;
    }
    public Integer getFlag() {
        return flag;
    }

    public MerchantMenu setFlag(Integer flag) {
        this.flag = flag;
        return this;
    }
    public Integer getSort() {
        return sort;
    }

    public MerchantMenu setSort(Integer sort) {
        this.sort = sort;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public MerchantMenu setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public MerchantMenu setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Integer getVersion() {
        return version;
    }

    public MerchantMenu setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public String getRemark() {
        return remark;
    }

    public MerchantMenu setRemark(String remark) {
        this.remark = remark;
        return this;
    }
    public Integer getDeleted() {
        return deleted;
    }

    public MerchantMenu setDeleted(Integer deleted) {
        this.deleted = deleted;
        return this;
    }

    public static final String ID = "id";

    public static final String MENU_NAME = "menu_name";

    public static final String REQUEST_URL = "request_url";

    public static final String MENU_ICON = "menu_icon";

    public static final String PARENT_ID = "parent_id";

    public static final String COMPONENT = "component";

    public static final String FLAG = "flag";

    public static final String SORT = "sort";

    public static final String UPDATE_TIME = "update_time";

    public static final String CREATE_TIME = "create_time";

    public static final String VERSION = "version";

    public static final String REMARK = "remark";

    public static final String DELETED = "deleted";

    @Override
    public String toString() {
        return "MerchantMenu{" +
            "id=" + id +
            ", menuName=" + menuName +
            ", requestUrl=" + requestUrl +
            ", menuIcon=" + menuIcon +
            ", parentId=" + parentId +
            ", component=" + component +
            ", flag=" + flag +
            ", sort=" + sort +
            ", updateTime=" + updateTime +
            ", createTime=" + createTime +
            ", version=" + version +
            ", remark=" + remark +
            ", deleted=" + deleted +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            MerchantMenu.ID
            ,MerchantMenu.MENU_NAME
            ,MerchantMenu.REQUEST_URL
            ,MerchantMenu.MENU_ICON
            ,MerchantMenu.PARENT_ID
            ,MerchantMenu.COMPONENT
            ,MerchantMenu.FLAG
            ,MerchantMenu.SORT
            ,MerchantMenu.UPDATE_TIME
            ,MerchantMenu.CREATE_TIME
            ,MerchantMenu.VERSION
            ,MerchantMenu.REMARK
            ,MerchantMenu.DELETED
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}